package com.llmcu.source.spring.demo;

import com.llmcu.source.spring.demo.service.WelcomeService;
import org.springframework.beans.factory.support.BeanDefinitionReader;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;

public class Entrance2 {
	public static void main(String[] args) {
		Resource resource = new ClassPathResource("spring/spring-config.xml");

		DefaultListableBeanFactory defaultListableBeanFactory = new DefaultListableBeanFactory();

		BeanDefinitionReader beanDefinitionReader = new XmlBeanDefinitionReader(defaultListableBeanFactory);
		beanDefinitionReader.loadBeanDefinitions(resource);

		WelcomeService welcomeService = defaultListableBeanFactory.getBean("welcomeService", WelcomeService.class);
		welcomeService.sayHello("llmcu");


	}
}
